package com.thinkingcoder.tcrpc.demo.provider;

import org.springframework.stereotype.Component;

import com.thinkingcoder.tcrpc.core.annotation.TcProvider;
import com.thinkingcoder.tcrpc.demo.api.IOrderService;
import com.thinkingcoder.tcrpc.demo.api.Order;

@Component
@TcProvider
public class OrderServiceImpl implements IOrderService {
    @Override
    public Order findById(Integer id) {
        if (id == 404) {

            throw new RuntimeException("404 exception");
        }
        return new Order(id.longValue(), 15.6f);
    }
}
